<?php

namespace App\Enums;

/** 公用枚举
 * @method static static OptionOne()
 * @method static static OptionTwo()
 * @method static static OptionThree()
 */
final class NoticeType extends BaseEnum
{

    const NEWS = 1;
    const PROC = 2;
    const ACTIVITY = 3;

    public static function map()
    {
        return [
            self::NEWS=>"新闻",
            self::PROC=>"公告",
            self::ACTIVITY=>"活动",
        ];
    }

    public static function toKvArray(){
        $arr = self::map();
        $data = [];
        foreach ($arr as $key=>$name){
            $data[] = [
                'key'=>$key,
                'name'=>$name
            ];
        }
        return $data;
    }

}
